package com.kevms.phonewars;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

/** 
* @class CreateMatchType
* 
* @brief Activity for picking the type of match that you
* would like to create.
* 
* This Activity the appropriate number of buttons shown in
* the view dependent on the number of match types available.
*/ 
public class CreateMatchType extends Activity {

	Context mContext;
	
	private SQLiteDatabase db;
	private MySQLiteHelper dbHelper;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.create_match_type);
		
		dbHelper = MySQLiteHelper.getInstance(getApplicationContext());
		db = dbHelper.getWritableDatabase();
		LinearLayout l = (LinearLayout)findViewById(R.id.topLayout);
    	l.setBackgroundColor(dbHelper.getBgColor(db));
		
		Button btnDM = (Button)findViewById(R.id.btnDM);
		//Button btnCTF = (Button)findViewById(R.id.btnCTF);
		mContext = this;
		
		btnDM.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				Intent intent = new Intent(mContext, CreateMatchDM.class);
				startActivityForResult(intent,0);
			}
		});
		
		/*
		btnCTF.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				//Intent intent = new Intent(mContext, CreateMatchCTF.class);
				//startActivityForResult(intent,1);
			}
		});
		*/
	}
	
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		finish();
    }
}
